const fs=require('fs');
let p=new Promise((resolve,reject)=>{
	fs.readFile('./files/a.txt','utf-8',(err,data)=>{
		/*if(err){
			reject(err);
		}else{
			resolve(data.length);
		}*/
		err?reject(err):resolve(data.length);
	})
});
p.then(result=>{
	console.log(result);
	return new Promise((resolve,reject)=>{
		fs.readFile('./files/b.txt','utf-8',(err,data)=>{
			err?reject(err):resolve(data.length);
		})
	})
}).then(result=>{
	console.log(result);
	return new Promise((resolve,reject)=>{
		fs.readFile('./files/c.txt','utf-8',(err,data)=>{
			err?reject(err):resolve(data.length);
		})
	})
}).then(result=>{
	console.log(result);
}).cathch(err=>{
	console.log(err);
});